package com.zez.controller;

import com.zez.common.util.RE;
import com.zez.entity.Student;
import com.zez.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
@CrossOrigin
public class StudentController {
    @Autowired
    private StudentService studentService;
    @GetMapping("/list")
    public RE findAll(){
        List<Student> list=studentService.list();
        return RE.ok().data("list",list);
    }
}
